begintownscript;
variables;
    int choice;
body;
beginstate INIT_STATE;

break;
beginstate EXIT_STATE;

break;
beginstate START_STATE;

break;
beginstate 10;
    if (get_flag(17, 0) == 0)
        message_dialog("This vahnatai settlement is just a small dock and a guard tower. The ferryman seems not to be vacant.", "");
    set_flag(17, 0, 1);
break;
beginstate 11;
    reset_dialog();
    add_dialog_str(0, "This is a mind crystal. Orange mind crystals are capable of recording events. Would you like to look inside it what it has recorded.", 0);
    add_dialog_choice(0, "No");
    add_dialog_choice(1, "Yes");
    choice = run_dialog(0);
    if (choice == 2)
    {
    if (get_flag(15, 4) == 1)
    {
        set_total_visibility(1);
        set_flag(15, 4, 2);
        spawn_creature(12);
        spawn_creature(13);
        spawn_creature(14);
        activate_hidden_group(1);
        force_view_center(15, 15);
        relocate_character(12, 15, 23);
        relocate_character(13, 15, 24);
        relocate_character(14, 15, 25);
        force_instant_terrain_redraw();
        
        relocate_character(12, 15, 22);
        relocate_character(13, 15, 23);
        relocate_character(14, 15, 24);
        force_instant_terrain_redraw();
        pause(5);
        
        relocate_character(12, 15, 21);
        relocate_character(13, 15, 22);
        relocate_character(14, 15, 23);
        force_instant_terrain_redraw();
        pause(5);
        
        relocate_character(12, 15, 20);
        relocate_character(13, 15, 21);
        relocate_character(14, 15, 22);
        force_instant_terrain_redraw();
        pause(5);
        
        relocate_character(12, 15, 19);
        relocate_character(13, 15, 20);
        relocate_character(14, 15, 21);
        force_instant_terrain_redraw();
        pause(5);
        
        relocate_character(12, 15, 18);
        relocate_character(13, 15, 19);
        relocate_character(14, 15, 20);
        force_instant_terrain_redraw();
        pause(5);
        
        relocate_character(12, 15, 17);
        relocate_character(13, 15, 18);
        relocate_character(14, 15, 19);
        force_instant_terrain_redraw();
        pause(5);
        
        relocate_character(12, 15, 16);
        relocate_character(13, 15, 17);
        relocate_character(14, 15, 18);
        force_instant_terrain_redraw();
        pause(5);
        
        relocate_character(12, 15, 15);
        relocate_character(13, 15, 16);
        relocate_character(14, 15, 17);
        force_instant_terrain_redraw();
        pause(5);
        
        relocate_character(12, 15, 14);
        relocate_character(13, 15, 15);
        relocate_character(14, 15, 16);
        set_character_facing(12, 4);
        force_instant_terrain_redraw();
        pause(5);
        
        text_bubble_on_char(12, "Now we are trapped in a cave!");
        force_instant_terrain_redraw();
        pause(20);
        
        text_bubble_on_char(12, "");
        text_bubble_on_char(14, "Says who? I know the way out!");
        force_instant_terrain_redraw();
        pause(20);
        
        text_bubble_on_char(14, "");
        text_bubble_on_char(12, "But once we're out, where shall we go?");
        force_instant_terrain_redraw();
        pause(30);
        
        text_bubble_on_char(12, "");
        text_bubble_on_char(13, "To my place!");
        force_instant_terrain_redraw();
        pause(20);
        
        text_bubble_on_char(13, "");
        text_bubble_on_char(13, "I have built a hidden outpost");
        force_instant_terrain_redraw();
        pause(30);
        
        text_bubble_on_char(13, "");
        text_bubble_on_char(13, "some miles south from Goldar.");
        force_instant_terrain_redraw();
        pause(40);
        
        set_character_facing(12, 0);
        text_bubble_on_char(13, "");
        text_bubble_on_char(12, "Let's get going!");
        while (char_loc_y(12) > 2)
        {
            relocate_character(12, char_loc_x(12), char_loc_y(12) - 1);
            relocate_character(13, char_loc_x(13), char_loc_y(13) - 1);
            relocate_character(14, char_loc_x(14), char_loc_y(14) - 1);
            force_instant_terrain_redraw();
            pause(2);
        }
        erase_char(12);
        erase_char(13);
        erase_char(14);
        set_total_visibility(0);
        }
        else message_dialog("It would appear that this mind crystal is empty.", "");
        }
break;

beginstate 12;
  if (get_flag(212, 4) == 2)
  {
    message_dialog("It doesn't take long before the vahnatai arrives. It commands you into the boat, then self gets into it, and then it takes you to a big castle.", "");
    move_to_new_town(4, 6, 30);
  }
break;